
$(function(){
	showColor;
	showWhite();
	$("#citys").hide();
	//导航栏的点击事件
	$("#menu_1").on("click", menu);
	$("#menu_2").on("click", menu);
	$("#menu_3").on("click", menu);
	$("#menu_4").on("click", menu);
	
	
});

function showWhite(){
	$(".fenlei").parent().css("background-color","white")
}
function showColor(obj){
	showWhite();
	$(obj).parent().css("background-color","#fde6b8")
}


//城市
//定位
$(function(){
	 
})
function showCity() {
    $("#citys").show();
}
function hideCity(m) {
    $('#citys').hide();
    $(".location_ysy_name").text($(m).text());
}

//导航栏变色切换
function menu_ysy(){
	var obj = this;
	/*把四格图标换成灰色*/
	for(var i=0;i<length;i++){
		$("#menu_"+(i+1)+" div img").attr("src",menu_img_url1[i]);
		$("#menu_"+(i+1)+" span").css("color","#999999");
	}
	var index1 = $(obj).attr("id").split("_")[1];
	var in1 = parseInt(index1)-1;
	$(obj).children().eq(0).children().eq(0).attr("src",menu_img_url2[in1]);
	$(obj).children().eq(1).css("color","#faac14");
}


//导航切换
var state = 1;
function menu() {
	var obj = this;
	state++;
	/*把四格图标换成灰色*/
	$("#menu_1 img").attr("src", "../../../img/app/index/meu/shouye.png");
	$("#menu_2 img").attr("src", "../../../img/app/famous_person/down/famous_hui.png");
	$("#menu_3 img").attr("src", "../../../img/app/famous_person/down/article.png");
	$("#menu_4 img").attr("src", "../../../img/app/famous_person/down/guanzhu.png");
	$("#menu_1 span").css("color", "rgb(153,153,153)");
	$("#menu_2 span").css("color", "rgb(153,153,153)");
	$("#menu_3 span").css("color", "rgb(153,153,153)");
	$("#menu_4 span").css("color", "rgb(153,153,153)");
	var index = "1";
	if(state != 1) {
		index = $(obj).attr("id").split("_")[1];
	}
	var url = "";
	var jump_url = "";//=======这里可以填写跳转路径===============
	switch(index) {
		case "1":
			url = "../../../img/app/index/meu/shouyese.png";
			jump_url="";
			break;
		case "2":
			url = "../../../img/app/famous_person/down/famous.png";
			jump_url="";
			break;
		case "3":
			url = "../../../img/app/famous_person/down/wenzhang2.png";
			jump_url="";
			break;
		case "4":
			url = "../../../img/app/famous_person/down/guanzhu2.png";
			jump_url="";
			break;
	}
	if(state != 1) {
		$(obj).children().eq(0).children().eq(0).attr("src", url);
		$(obj).children().eq(1).css("color", "rgb(250,172,20)");
//		window.location.href=jump_url;    //跳转
	} else {
		$("#menu_1").children().eq(0).attr("src", url);
	}
	
	
	
}